SplatMesh 🫟

SplatMesh is a small Wolfram Language [paclet](https://github.com/JerryI/wl-splatmesh) for importing, manipulating, and exporting Gaussian splatting meshes (`.spz` files). It provides a compact in-memory representation of splats (centers, scales, orientations, color and opacity data) using [SPZ format](https://github.com/nianticlabs/spz), extends default `Import`, `Export` expressions, allows bulk operations, simple transformations, and a lightweight preview using Wolfram Standard Library.

https://github.com/JerryI/wl-splatmesh

Load the library

*if you run it from examples directory*

PacletDirectoryLoad[NotebookDirectory[]]; <<CoffeeLiqueur`Workshop`SplatMesh` Import a butterfly

mesh = Import[FileNameJoin[{"Examples", "butterfly.spz"}], "SPZ"] Show properties and a preview using 3D points

mesh["Properties"] mesh["Preview"] :::tip

__A note for WLJS Notebook users__

This paclet is intentionally tiny and designed to integrate with open-source [Spark.js](https://sparkjs.dev/) ✨ library for GPU-based rendering in browser contexts. Since WLJS Notebook is a web-based app, **you can fully render and integrate Gaussian splats with your Graphics3D routies**

:::

Graphics3D[{ GeometricTransformation[ mesh, RotationMatrix[-75Degree, {1,1,0}] ] }] Graphics3D[{ Import[FileNameJoin[{"Examples", "tap.spz"}], "SPZ"] }] *Try to zoom in* 💡

Transformations

Apply rotation matrix:

rotated = TransformedSplat[ mesh, RotationMatrix[Pi/2, {1,0,0}] // N ]; Export transformed model

Export["butterfly_rotated.spz", rotated, "SPZ"] Append more splats to a mesh

Append[mesh, { {0.,0.,0.}, {0.01, 0.1, 0.9}, {.0, .0, .0, 1.0}, 1.0, {1.0,.0,.0} }] // Graphics3D :::tip

See [README.md](https://github.com/JerryI/wl-splatmesh) for more API features

:::